package com.action.sanction;

import java.util.ArrayList;

import com.db.appline.AppLineManager;
import com.db.appline.RepDateVO;
import com.db.member.MemberManager;
import com.db.member.MemberVO;
import com.db.sancdoc.DocParamVO;
import com.db.sancdoc.VDocManager;
import com.db.sancdoc.VTDocManager;
import com.db.sancdoc.VTDocVO;
import com.opensymphony.xwork2.ActionContext;

public class UndecidedAction {
	private int memno;

	ArrayList<VTDocVO> list = new ArrayList<VTDocVO>();

	MemberVO vo = new MemberVO();

	private int doccount;
	private int totalpage;
	private int curpage;
	private DocParamVO paramVo = new DocParamVO();
	
	
	public int getCurpage() {
		return curpage;
	}

	public void setCurpage(int curpage) {
		this.curpage = curpage;
	}

	public int getTotalpage() {
		return totalpage;
	}



	public int getDoccount() {
		return doccount;
	}

	private RepDateVO dateVo = new RepDateVO();

	public void setMemno(int memno) {
		this.memno = memno;
	}

	public ArrayList<VTDocVO> getList() {
		return list;
	}

	public MemberVO getVo() {
		return vo;
	}

	public RepDateVO getDateVo() {
		return dateVo;
	}

	public String execute() throws Exception {
		dateVo = AppLineManager.getRepdate();
memno = Integer.parseInt((String) ActionContext.getContext().getSession().get("memno"));//////////////////////////////////////////////////

		System.out.println(memno);

		System.out.println("UndecidedAction");

		vo = MemberManager.memberData(memno);

		paramVo = getDocParam(memno, curpage);
		
		list = VTDocManager.undecidedDocList(paramVo);

		
		doccount = VTDocManager.undecideCount(memno);
		totalpage = ((doccount-1) / 10) + 1;
		
		

		
		return "success";
	}
	
	public DocParamVO getDocParam(int memno, int curpage) {
		DocParamVO vo = new DocParamVO();
		vo.setMemno(memno);
		vo.setBegin((curpage * 10) - 9);
		vo.setEnd(curpage * 10);
		

		return vo;
	}
}
